package descentFly.away3D4
{
	import descentFly.df_optionsObject;
	
	import flash.events.Event;
	
	public class df_baseSpaceElement extends df_optionsObject {
		private var _space		: df_awaySpace;
		public function df_baseSpaceElement(a_space: df_awaySpace, a_options: Object) {
			_space = a_space;
			super(a_options);
			callWaitInit();
		}
		
		protected function callWaitInit(): void {
			Space.callWaitEnv(initialize);
		}
		
		protected function initialize(): void {
		}
		
		override protected function listenEvents(): void {
			super.listenEvents();
			Space.addEventListener(Event.CLEAR, doSpaceClear);
		}
		
		override protected function removeEvents(): void {
			Space.removeEventListener(Event.CLEAR, doSpaceClear);
		}
		
		private function doSpaceClear(e: Event): void {
			dispose();
		}
		
		public function get Space(): df_awaySpace {
			return _space;
		}
	}
}